\(\int \frac {1}{1+\cot ^3(x)} \, dx\) [59]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 8, antiderivative size = 37 \[ \int \frac {1}{1+\cot ^3(x)} \, dx=\frac {x}{2}-\frac {1}{6} \log (1+\cot (x))+\frac {1}{3} \log \left (1-\cot (x)+\cot ^2(x)\right )+\frac {1}{2} \log (\sin (x)) \]

[Out]

1/2*x-1/6*ln(1+cot(x))+1/3*ln(1-cot(x)+cot(x)^2)+1/2*ln(sin(x))

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.750, Rules used = {3742, 2099, 649, 209, 266, 642} \[ \int \frac {1}{1+\cot ^3(x)} \, dx=\frac {x}{2}+\frac {1}{2} \log (\sin (x))+\frac {1}{3} \log \left (\cot ^2(x)-\cot (x)+1\right )-\frac {1}{6} \log (\cot (x)+1) \]

[In]

Int[(1 + Cot[x]^3)^(-1),x]

[Out]

x/2 - Log[1 + Cot[x]]/6 + Log[1 - Cot[x] + Cot[x]^2]/3 + Log[Sin[x]]/2

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 2099

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rule 3742

Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x]
, x]}, Dist[c*(ff/f), Subst[Int[(a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ
[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \left (1+x^3\right )} \, dx,x,\cot (x)\right ) \\ & = -\text {Subst}\left (\int \left (\frac {1}{6 (1+x)}+\frac {1+x}{2 \left (1+x^2\right )}+\frac {1-2 x}{3 \left (1-x+x^2\right )}\right ) \, dx,x,\cot (x)\right ) \\ & = -\frac {1}{6} \log (1+\cot (x))-\frac {1}{3} \text {Subst}\left (\int \frac {1-2 x}{1-x+x^2} \, dx,x,\cot (x)\right )-\frac {1}{2} \text {Subst}\left (\int \frac {1+x}{1+x^2} \, dx,x,\cot (x)\right ) \\ & = -\frac {1}{6} \log (1+\cot (x))+\frac {1}{3} \log \left (1-\cot (x)+\cot ^2(x)\right )-\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (x)\right )-\frac {1}{2} \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\cot (x)\right ) \\ & = \frac {x}{2}-\frac {1}{6} \log (1+\cot (x))+\frac {1}{3} \log \left (1-\cot (x)+\cot ^2(x)\right )+\frac {1}{2} \log (\sin (x)) \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.05 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.54 \[ \int \frac {1}{1+\cot ^3(x)} \, dx=\left (-\frac {1}{4}-\frac {i}{4}\right ) \log (i-\tan (x))-\left (\frac {1}{4}-\frac {i}{4}\right ) \log (i+\tan (x))-\frac {1}{6} \log (1+\tan (x))+\frac {1}{3} \log \left (1-\tan (x)+\tan ^2(x)\right ) \]

[In]

Integrate[(1 + Cot[x]^3)^(-1),x]

[Out]

(-1/4 - I/4)*Log[I - Tan[x]] - (1/4 - I/4)*Log[I + Tan[x]] - Log[1 + Tan[x]]/6 + Log[1 - Tan[x] + Tan[x]^2]/3

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.84

method result size
parallelrisch \(\frac {x}{2}+\ln \left (\frac {1}{\left (\tan \left (x \right )+1\right )^{\frac {1}{6}}}\right )+\ln \left (\frac {1}{\left (\sec \left (x \right )^{2}\right )^{\frac {1}{4}}}\right )+\ln \left (\left (-\tan \left (x \right )+\sec \left (x \right )^{2}\right )^{\frac {1}{3}}\right )\) \(31\)
norman \(\frac {x}{2}-\frac {\ln \left (\tan \left (x \right )+1\right )}{6}-\frac {\ln \left (\tan \left (x \right )^{2}+1\right )}{4}+\frac {\ln \left (\tan \left (x \right )^{2}-\tan \left (x \right )+1\right )}{3}\) \(34\)
risch \(\frac {x}{2}-\frac {i x}{2}-\frac {\ln \left ({\mathrm e}^{2 i x}+i\right )}{6}+\frac {\ln \left ({\mathrm e}^{4 i x}-4 i {\mathrm e}^{2 i x}-1\right )}{3}\) \(38\)
derivativedivides \(\frac {\ln \left (1-\cot \left (x \right )+\cot \left (x \right )^{2}\right )}{3}-\frac {\ln \left (\cot \left (x \right )^{2}+1\right )}{4}-\frac {\pi }{4}+\frac {\operatorname {arccot}\left (\cot \left (x \right )\right )}{2}-\frac {\ln \left (1+\cot \left (x \right )\right )}{6}\) \(39\)
default \(\frac {\ln \left (1-\cot \left (x \right )+\cot \left (x \right )^{2}\right )}{3}-\frac {\ln \left (\cot \left (x \right )^{2}+1\right )}{4}-\frac {\pi }{4}+\frac {\operatorname {arccot}\left (\cot \left (x \right )\right )}{2}-\frac {\ln \left (1+\cot \left (x \right )\right )}{6}\) \(39\)

[In]

int(1/(1+cot(x)^3),x,method=_RETURNVERBOSE)

[Out]

1/2*x+ln(1/(tan(x)+1)^(1/6))+ln(1/(sec(x)^2)^(1/4))+ln((-tan(x)+sec(x)^2)^(1/3))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.65 \[ \int \frac {1}{1+\cot ^3(x)} \, dx=\frac {1}{2} \, x - \frac {1}{12} \, \log \left (\sin \left (2 \, x\right ) + 1\right ) + \frac {1}{3} \, \log \left (-\frac {1}{2} \, \sin \left (2 \, x\right ) + 1\right ) \]

[In]

integrate(1/(1+cot(x)^3),x, algorithm="fricas")

[Out]

1/2*x - 1/12*log(sin(2*x) + 1) + 1/3*log(-1/2*sin(2*x) + 1)

Sympy [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.92 \[ \int \frac {1}{1+\cot ^3(x)} \, dx=\frac {x}{2} - \frac {\log {\left (\tan {\left (x \right )} + 1 \right )}}{6} - \frac {\log {\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{4} + \frac {\log {\left (\tan ^{2}{\left (x \right )} - \tan {\left (x \right )} + 1 \right )}}{3} \]

[In]

integrate(1/(1+cot(x)**3),x)

[Out]

x/2 - log(tan(x) + 1)/6 - log(tan(x)**2 + 1)/4 + log(tan(x)**2 - tan(x) + 1)/3

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.89 \[ \int \frac {1}{1+\cot ^3(x)} \, dx=\frac {1}{2} \, x + \frac {1}{3} \, \log \left (\tan \left (x\right )^{2} - \tan \left (x\right ) + 1\right ) - \frac {1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) - \frac {1}{6} \, \log \left (\tan \left (x\right ) + 1\right ) \]

[In]

integrate(1/(1+cot(x)^3),x, algorithm="maxima")

[Out]

1/2*x + 1/3*log(tan(x)^2 - tan(x) + 1) - 1/4*log(tan(x)^2 + 1) - 1/6*log(tan(x) + 1)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.92 \[ \int \frac {1}{1+\cot ^3(x)} \, dx=\frac {1}{2} \, x + \frac {1}{3} \, \log \left (\tan \left (x\right )^{2} - \tan \left (x\right ) + 1\right ) - \frac {1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) - \frac {1}{6} \, \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) \]

[In]

integrate(1/(1+cot(x)^3),x, algorithm="giac")

[Out]

1/2*x + 1/3*log(tan(x)^2 - tan(x) + 1) - 1/4*log(tan(x)^2 + 1) - 1/6*log(abs(tan(x) + 1))

Mupad [B] (verification not implemented)

Time = 13.79 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.00 \[ \int \frac {1}{1+\cot ^3(x)} \, dx=x\,\left (\frac {1}{2}-\frac {1}{2}{}\mathrm {i}\right )-\frac {\ln \left (12\,{\mathrm {e}}^{x\,2{}\mathrm {i}}+12{}\mathrm {i}\right )}{6}+\frac {\ln \left ({\mathrm {e}}^{x\,4{}\mathrm {i}}-1-{\mathrm {e}}^{x\,2{}\mathrm {i}}\,4{}\mathrm {i}\right )}{3} \]

[In]

int(1/(cot(x)^3 + 1),x)

[Out]

x*(1/2 - 1i/2) - log(12*exp(x*2i) + 12i)/6 + log(exp(x*4i) - exp(x*2i)*4i - 1)/3